package oops.innerclasses;

public class ClassEnclosingInnerClass {
	
	private int i = 0;
	private char ch = 'p';
	private String str = "ENCLOSING-CLASS";
	
	class MyInnerClass {
		public void process() {
			i = 1;
			ch = 'c';
			updateStr("INNER-CLASS");	
		}
	}
	
	private void updateStr(String str) {
		this.str = str; 
	}
	
	public void printData() {
		System.out.println("\n\nDATA: "
				+ "i = " + i
				+ "\tch = " + ch
				+ "\tstr = " + str
		);
	}

	public static void main(String[] args) {
		ClassEnclosingInnerClass cl = new ClassEnclosingInnerClass();
		cl.printData();

		MyInnerClass mic = cl.new MyInnerClass();
		mic.process();
		
		cl.printData();
	}

}
